$(document).ready(function(){
	login();
});

function login(){
	$("#login").on("click",function(){
		var name =Base64.encode($("#name").val());
		var password = Base64.encode($("#password").val());
		debugger;
		var userpojo ={};
		userpojo.name = name;
		userpojo.password = password;
		$.ajax({
			url:"./login.do",
			type:"POST",
			dataType: "json", 
			data:JSON.stringify(userpojo),
			contentType: "application/json",
			success:function(res){
				if(res.isOk){
					window.location.href="mode/mode.html"; 
				}else{
					
				}
			}
		});
	});
}